package com.github.prontera.domain.enums;

import com.github.prontera.common.mybatis.handler.CodeEnum;

public enum ClientConsumeTypeEnum implements CodeEnum<ClientConsumeTypeEnum> {

	TALEND_CONSUME(0, "talend_consume"),//达人消费
	TALEND_INCOME(1, "talend_income"),//达人收入
	TASK(2, "task"),//任务保证金
	SKILL(3, "skill"),//技能激活码
	CASH_COUPON(4, "cash_coupon")//提现劵收益
	;
	
	private int code;
	private String desc;

	private ClientConsumeTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	/**
     * 通过枚举<code>name</code>获取枚举
     */
    public static ClientConsumeTypeEnum getEnumByCode(Integer code) {
    	if(code==null){
    		return null;
    	}
        for (ClientConsumeTypeEnum enumm : ClientConsumeTypeEnum.values()) {
            if (enumm.getCode()==code.intValue()) {
                return enumm;
            }
        }
        return null;
    }
    
	@Override
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
	
}
